$(function(){
	$("#cancleBut").click(function(){
		parent.$('#dlg').window('close');
		parent.$(document.body).remove()
	});
	var codelength=$('#departmentCode').width();
	$('#departmentCode').validatebox({
	    required: true,
	    validType: {
	    	custom_remote:['/base/department/checkCode',departmentCode,'编号已存在']
	    },
	    tipPosition:'top',
	    delay:500,
	    deltaX:codelength/4
	});
	$('#sort').validatebox({
	    required: true,
	    validType: 'integer',
	    tipPosition:'top',
	    deltaX:codelength/4
	});
})